package com.cloud.schedule.api.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import com.cloud.schedule.api.service.LoggerService;

public class QuartzJobFactory implements Job {
	
	@Autowired
	private LoggerService loggerService;

	@Override
	public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
    	ScheduleJob scheduleJob = (ScheduleJob)jobExecutionContext.getMergedJobDataMap().get("scheduleJob");
    	
    	// 记录任务调度时间相关日志
    	long logId = loggerService.logger(scheduleJob);
    	
    	System.out.println(">>>>>>"+scheduleJob.getInterfaceName());
    	
    	// 采用MQ异步的通知业务系统执行定时任务
//    	 sender.send(scheduleJob.getInterfaceName());
    	
	}

}
